﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Ext.Master" AutoEventWireup="true"
    CodeBehind="Grouping.aspx.cs" Inherits="MVCnExt.Views.Grid.Grouping" %>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <mvc:ExtWindow ID="extWindow" contentEl="extWindow" autoHeight="true" title="Grouping Grid"
        Width="413" runat="server">
        <items>
            <mvc:ExtGridPanel ID="ExtGridPanel1" autoHeight="true" runat="server">
                <cm>
                    <mvc:ExtColumn header="Industry" sortable="true" dataIndex="test" />
                    <mvc:ExtColumn header="Company" sortable="true" dataIndex="name" />
                </cm>
                <store>
                    <mvc:ExtGroupingStore groupField="test" autoLoad="true">
                        <sortInfo field="test" direction="ASC" />
                        <data>
                              testData
                        </data>
                        <reader>
                            <mvc:ExtArrayReader>
                                <fields>
                                    <mvc:ExtRecord name="name" />
                                    <mvc:ExtRecord name="address" />
                                    <mvc:ExtRecord name="test" />
                                </fields>
                            </mvc:ExtArrayReader>
                        </reader>
                    </mvc:ExtGroupingStore>
                </store>
                <view>
                    <mvc:ExtGroupingView forceFit="true" groupTextTpl="{text} ({[values.rs.length]})"
                        ID="gview" runat="server">
                    </mvc:ExtGroupingView>
                </view>
            </mvc:ExtGridPanel></items>
    </mvc:ExtWindow>
    <mvc:ExtOnReady ID="windowOnReady" runat="server">

        <script>
            extWindow.show();
        </script>

    </mvc:ExtOnReady>

    <script>
        // Array data for the grids
        testData = [
    ['Avon Products', '1345 Ave. of the Americas, New York', 'Do not test'],
    ['Ecover', '2349 S. Eastern Ave., Los Angeles', 'Do not test'],
    ['Safeway', '5918 Stoneridge Mall Rd., Pleasanton', 'Do not test'],
    ['TerraNova', '1011 Gilman St., Berkeley', 'Do not test'],
    ['Warm Earth Cosmetics', '1155 Stanley Ave.', 'Do not test'],
    ['Weleda, Inc.', '1 Closter Rd., Palisades, NY 10964', 'Do not test'],
    ['The Wella Corporation', '6109 De Soto, Woodland Hills', 'Do not test'],
    ['Whole Foods Market', '550 Bowie St., Austin', 'Do not test'],
    ['Johnson & Johnson', '1 Johnson & Johnson Plz., New Brunswick', 'Do test'],
    ['Colgate-Palmolive Co.', '300 Park Ave., New York', 'Do test'],
    ['Max Factor', 'One Procter & Gamble Plz.', 'Do test'],
    ['Oral-B', '600 Clipper Dr., Belmont', 'Do test'],
    ['Pantene', 'One Procter & Gamble Plz.', 'Do test'],
    ['Procter & Gamble Co.', 'One Procter & Gamble Plz.', 'Do test'],
    ['Unilever', '800 Sylvan Ave., Englewood Cliffs', 'Do test']
];

    </script>

</asp:Content>
